<template>
    <span class="search-component">
        <Button type="default" class="expandbtn btn-search" :class="{expand:isExpand}" @click="expand" >查询 <i class="iconfont icon-jiantoushouqi"></i></Button>
        <Collapse v-model="isExpand" class="search-collapse">
            <Panel name="search-form">
                <div slot="content">
                    <slot></slot>
                </div>
            </Panel>
        </Collapse>
    </span>
</template>
<script>
export default {
    name: 'SearchExpand',
    data () {
        return {
            isExpand: ''
        }
    },
    methods: {
        expand () {
            if (this.isExpand === '') {
                this.isExpand = 'search-form'
            } else {
                this.isExpand = ''
            }
        }
    }
}
</script>
